fix bug in garmin_txt reader that could result in uninitialised value(s) being used...
authortsteven4 <tsteven4@f51c46e8-681c-474f-0cfe-069cfd0219fb>
Sun, 1 Sep 2013 17:23:02 +0000 (17:23 +0000)
committertsteven4 <tsteven4@f51c46e8-681c-474f-0cfe-069cfd0219fb>
Sun, 1 Sep 2013 17:23:02 +0000 (17:23 +0000)
git-svn-id: http://gpsbabel.googlecode.com/svn/trunk@4586 f51c46e8-681c-474f-0cfe-069cfd0219fb

gpsbabel/garmin_txt.cc

index 0a90649645eec93d4cb242a7adce40b356759b5f..60dc628a232765d5b09068faeeb1696e6bc5b320 100644 (file)
@@ -1195,8 +1195,9 @@ parse_waypoint(void)
       break;
     case 16: {
       time_t ct;
-      parse_date_and_time(str, &ct);
-      wpt->SetCreationTime(ct);
+      if (parse_date_and_time(str, &ct)) {
+        wpt->SetCreationTime(ct);
+      }
     }
     break;
     case 17: {
@@ -1313,8 +1314,9 @@ parse_track_waypoint(void)
       break;
     case 2: {
       time_t ct;
-      parse_date_and_time(str, &ct);
-      wpt->SetCreationTime(ct);
+      if (parse_date_and_time(str, &ct)) {
+        wpt->SetCreationTime(ct);
+      }
     }
     break;
     case 3: